package com.chenyaowei.product.service.impl;

import com.chenyaowei.product.domain.CywProSpuImages;
import com.chenyaowei.product.mapper.CywProSpuImagesMapper;
import com.chenyaowei.product.service.ICywProSpuImagesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * spu图片集Service业务层处理
 *
 * @author 陈耀威
 * @date 2023-11-24
 */
@Service
public class CywProSpuImagesServiceImpl implements ICywProSpuImagesService
{
    @Autowired
    private CywProSpuImagesMapper cywProSpuImagesMapper;

    /**
     * 查询spu图片集
     *
     * @param id spu图片集主键
     * @return spu图片集
     */
    @Override
    public CywProSpuImages selectCywProSpuImagesById(Long id)
    {
        return cywProSpuImagesMapper.selectCywProSpuImagesById(id);
    }

    /**
     * 查询spu图片集列表
     *
     * @param cywProSpuImages spu图片集
     * @return spu图片集
     */
    @Override
    public List<CywProSpuImages> selectCywProSpuImagesList(CywProSpuImages cywProSpuImages)
    {
        return cywProSpuImagesMapper.selectCywProSpuImagesList(cywProSpuImages);
    }

    /**
     * 新增spu图片集
     *
     * @param cywProSpuImages spu图片集
     * @return 结果
     */
    @Override
    public int insertCywProSpuImages(CywProSpuImages cywProSpuImages)
    {
        return cywProSpuImagesMapper.insertCywProSpuImages(cywProSpuImages);
    }

    /**
     * 修改spu图片集
     *
     * @param cywProSpuImages spu图片集
     * @return 结果
     */
    @Override
    public int updateCywProSpuImages(CywProSpuImages cywProSpuImages)
    {
        return cywProSpuImagesMapper.updateCywProSpuImages(cywProSpuImages);
    }

    /**
     * 批量删除spu图片集
     *
     * @param ids 需要删除的spu图片集主键
     * @return 结果
     */
    @Override
    public int deleteCywProSpuImagesByIds(Long[] ids)
    {
        return cywProSpuImagesMapper.deleteCywProSpuImagesByIds(ids);
    }

    /**
     * 删除spu图片集信息
     *
     * @param id spu图片集主键
     * @return 结果
     */
    @Override
    public int deleteCywProSpuImagesById(Long id)
    {
        return cywProSpuImagesMapper.deleteCywProSpuImagesById(id);
    }

    @Override
    public int saveBatch(List<CywProSpuImages> spuImagesList) {
       return cywProSpuImagesMapper.saveBatch(spuImagesList);
    }

    @Override
    public List<CywProSpuImages> selectListBySpuIds(List<Long> spuIds) {
        return cywProSpuImagesMapper.selectListBySpuIds(spuIds);
    }
}
